package com.cwm.test.proxy.autocode.proxy;

import com.cwm.test.proxy.autocode.client.Source;

import java.lang.reflect.*;

/**
 * * 动态代理类
 */
public class $Proxy1 extends GPProxy implements Source {
    GPInvocationHandler h;

    public $Proxy1(GPInvocationHandler invocationhandler) {
        this.h = invocationhandler;
    }

    public boolean equals(Object obj) {
        try {
            return ((Boolean) h.invoke(this, m1, new Object[]{
                    obj
            })).booleanValue();
        } catch (Throwable throwable) {
            throw new UndeclaredThrowableException(throwable);
        }
    }

    public String toString() {
        try {
            return (String) h.invoke(this, m2, null);
        } catch (Throwable throwable) {
            throw new UndeclaredThrowableException(throwable);
        }
    }

    public int mul(int i, int j) {
        try {
            return ((Integer) h.invoke(this, m6, new Object[]{
                    Integer.valueOf(i), Integer.valueOf(j)
            })).intValue();
        } catch (Throwable throwable) {
            throw new UndeclaredThrowableException(throwable);
        }
    }

    public int add(int i, int j) {
        try {
            return ((Integer) h.invoke(this, m3, new Object[]{
                    Integer.valueOf(i), Integer.valueOf(j)
            })).intValue();
        } catch (Throwable throwable) {
            throw new UndeclaredThrowableException(throwable);
        }
    }

    public int sub(int i, int j) {
        try {
            return ((Integer) h.invoke(this, m5, new Object[]{
                    Integer.valueOf(i), Integer.valueOf(j)
            })).intValue();
        } catch (Throwable throwable) {
            throw new UndeclaredThrowableException(throwable);
        }
    }

    public int div(int i, int j) {
        try {
            return ((Integer) h.invoke(this, m4, new Object[]{
                    Integer.valueOf(i), Integer.valueOf(j)
            })).intValue();
        } catch (Throwable throwable) {
            throw new UndeclaredThrowableException(throwable);
        }
    }

    public int hashCode() {
        try {
            return ((Integer) h.invoke(this, m0, null)).intValue();
        } catch (Throwable throwable) {
            throw new UndeclaredThrowableException(throwable);
        }
    }

    private static Method m1;
    private static Method m2;
    private static Method m6;
    private static Method m3;
    private static Method m5;
    private static Method m4;
    private static Method m0;

    static {
        try {
            m1 = Class.forName("java.lang.Object").getMethod("equals", new Class[]{
                    Class.forName("java.lang.Object")
            });
            m2 = Class.forName("java.lang.Object").getMethod("toString", new Class[0]);
            m6 = Class.forName("com.cwm.test.proxy.autocode.client.Source").getMethod("mul", new Class[]{
                    Integer.TYPE, Integer.TYPE
            });
            m3 = Class.forName("com.cwm.test.proxy.autocode.client.Source").getMethod("add", new Class[]{
                    Integer.TYPE, Integer.TYPE
            });
            m5 = Class.forName("com.cwm.test.proxy.autocode.client.Source").getMethod("sub", new Class[]{
                    Integer.TYPE, Integer.TYPE
            });
            m4 = Class.forName("com.cwm.test.proxy.autocode.client.Source").getMethod("div", new Class[]{
                    Integer.TYPE, Integer.TYPE
            });
            m0 = Class.forName("java.lang.Object").getMethod("hashCode", new Class[0]);
        } catch (NoSuchMethodException nosuchmethodexception) {
            throw new NoSuchMethodError(nosuchmethodexception.getMessage());
        } catch (ClassNotFoundException classnotfoundexception) {
            throw new NoClassDefFoundError(classnotfoundexception.getMessage());
        }
    }
}
